package fr.enseirbmatmeca.apms.spring.model.project;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import org.hibernate.annotations.GenericGenerator;

import fr.enseirbmatmeca.apms.spring.model.user.User;

@Entity
public class GlobalMark {
	/**
	 * 
	 * Global mark for a report or a presentation
	 * @author coudar
	 * 
	 */
	private String id;
	private float markValue;
	private List<MarkCriteria> criterion;
	private String comment;
	private User Reporter; //Can also be the tutor

	@Column
	public String getComment() {
		return comment;
	}
	@OneToMany(targetEntity=MarkCriteria.class, mappedBy="id", fetch=FetchType.LAZY)
	public List<MarkCriteria> getCriterion() {
		return criterion;
	}
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(unique = true, nullable = false)
	public String getId() {
		return id;
	}
	@Column(nullable = false)
	public float getMarkValue() {
		return markValue;
	}
	@Column(nullable = false)
	public User getReporter() {
		return Reporter;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	public void setCriterion(List<MarkCriteria> criterion) {
		this.criterion = criterion;
	}
	public void setId(String id) {
		this.id = id;
	}
	public void setMarkValue(float markValue) {
		this.markValue = markValue;
	}
	public void setReporter(User reporter) {
		Reporter = reporter;
	}


}
